
const originItemListInit = Window_QuestList.prototype.initialize;
Window_QuestList.prototype.initialize = function (x, y, width, height) {
    originItemListInit.call(this, x, y, width, height);
    this._backgroundSprite = new Sprite();
    this._backgroundSprite.bitmap =
        ImageManager.loadBitmap('img/system/UI/', 'MenuBg_QuestList');
    this.addChildAt(this._backgroundSprite, 0);
    this._backgroundSprite.x = -17;
    this._backgroundSprite.y = -1;
    this.opacity = 0;
};

// 设为15行
Window_QuestList.prototype.windowHeight = function() {
    return this.fittingHeight(15);
};

// 修改任务列表绘制格式
Window_QuestList.prototype.drawItem = function(index) {
    var rect = this.itemRectForText(index);
    var text = this.commandName(index);
    var symbol = this.commandSymbol(index);
    this.changePaintOpacity(this.isCommandEnabled(index));
    if (symbol === 'type') {
      var align = this.settings('Type Alignment');
    } else {
      var align = this.settings('Quest Alignment');
      var indent = parseInt(this.settings('Quest Indent'));
      rect.x += indent;
      rect.width -= indent;
    }
    var wx = 0;
    var ww = rect.width;
    if (align === 'left') {
      wx = rect.x;
      if (symbol !== 'type')
        text = "  " + text;
    } else if (align === 'center') {
      wx += (ww - this.textWidthEx(text)) / 2;
    } else {
      wx += ww - this.textWidthEx(text) - this.textPadding();
    }
    this.drawTextEx(text, wx, rect.y);
};
  